<?php 
class CartWS_Model_ZoneCost extends Ext_Db_Table
{
	protected $_name = 'sc_zone_cost';
    protected $_sequence = false;
    protected $_primary = array( 'zone_id', 'shipping_method_id' );

    public function getCostForMethod( $zoneId, $shippingMethodId )
	{
        $query = $this->select()
            ->setIntegrityCheck( false )
            ->from(
                array( 'scz' => 'SC_ZONE_COST' ),
                array( 'scz.shipping_cost_id, scz.zone_id, scz.shipping_method_id' ))
            ->join(
                array( 'scsc' => 'SC_SHIPPING_COST' ), 'scsc.shipping_cost_id = scz.shipping_cost_id' ,
                array( 'scsc.default_cost, scsc.additional_cost_item' ))
            ->where( 'scz.zone_id = ?', $zoneId )
            ->where( 'scz.shipping_method_id = ?', $shippingMethodId );

        return $this->fetchAll( $query );

    }
}
